package org.lili.semanticmodel;

/**
 * @author lili
 * @description 边
 * @create 2018-04-22 下午3:24
 * @since
 **/
public class Edge {

    /**
     * 起点
     */
    private Vertex fromVertex;

    /**
     * 终点
     */
    private Vertex toVertex;

    /**
     * 权重
     */
    private Double weight;

    public Edge() {
    }

    public Edge(Vertex fromVertex, Vertex toVertex, Double weight) {
        this.fromVertex = fromVertex;
        this.toVertex = toVertex;
        this.weight = weight;
    }

    @Override
    public String toString() {
        return fromVertex.getLabel() + " to " + toVertex.getLabel() + " with weight " + getWeight();
    }

    public Vertex getFromVertex() {
        return fromVertex;
    }

    public void setFromVertex(Vertex fromVertex) {
        this.fromVertex = fromVertex;
    }

    public Vertex getToVertex() {
        return toVertex;
    }

    public void setToVertex(Vertex toVertex) {
        this.toVertex = toVertex;
    }

    public Double getWeight() {
        return weight;
    }

    public void setWeight(Double weight) {
        this.weight = weight;
    }
}
